﻿using SD.Infrastructure.EntityBase;
using System;

namespace SlamDunk.MES.Domain.Entities.ExecutionContext
{
    /// <summary>
    /// 工单参数要求
    /// </summary>
    public class WorkOrderParameterAsk : PlainEntity, INumerable, INameable
    {
        #region # 构造器

        #region 00.无参构造器
        /// <summary>
        /// 无参构造器
        /// </summary>
        protected WorkOrderParameterAsk() { }
        #endregion

        #region 01.创建工单参数要求构造器
        /// <summary>
        /// 创建工单参数要求构造器
        /// </summary>
        /// <param name="parameterNo">参数编号</param>
        /// <param name="parameterName">参数名称</param>
        /// <param name="relatedVariableNo">对应变量编号</param>
        /// <param name="standardValue">标准值</param>
        /// <param name="maxValue">最大值</param>
        /// <param name="minValue">最小值</param>
        /// <param name="valueUnitNo">值单位编号</param>
        /// <param name="facilityId">工厂模型Id</param>
        /// <param name="sort">排序</param>
        /// <param name="description">描述</param>
        public WorkOrderParameterAsk(string parameterNo, string parameterName, string relatedVariableNo, decimal standardValue, decimal? maxValue, decimal? minValue, string valueUnitNo, Guid? facilityId, int sort, string description)
            : this()
        {
            this.Number = parameterNo;
            this.Name = parameterName;
            this.RelatedVariableNo = relatedVariableNo;
            this.StandardValue = standardValue;
            this.MaxValue = maxValue;
            this.MinValue = minValue;
            this.ValueUnitNo = valueUnitNo;
            this.FacilityId = facilityId;
            this.Sort = sort;
            this.Description = description;
        }
        #endregion

        #endregion

        #region # 属性

        #region 参数编号 —— string Number
        /// <summary>
        /// 参数编号
        /// </summary>
        public string Number { get; private set; }
        #endregion

        #region 参数名称 —— string Name
        /// <summary>
        /// 参数名称
        /// </summary>
        public string Name { get; private set; }
        #endregion

        #region 对应变量编号 —— string RelatedVariableNo
        /// <summary>
        /// 对应变量编号
        /// </summary>
        public string RelatedVariableNo { get; private set; }
        #endregion

        #region 标准值 —— decimal StandardValue
        /// <summary>
        /// 标准值
        /// </summary>
        public decimal StandardValue { get; private set; }
        #endregion

        #region 最大值 —— decimal? MaxValue
        /// <summary>
        /// 最大值
        /// </summary>
        public decimal? MaxValue { get; private set; }
        #endregion

        #region 最小值 —— decimal? MinValue
        /// <summary>
        /// 最小值
        /// </summary>
        public decimal? MinValue { get; private set; }
        #endregion

        #region 值单位编号 —— string ValueUnitNo
        /// <summary>
        /// 值单位编号
        /// </summary>
        public string ValueUnitNo { get; private set; }
        #endregion

        #region 工厂模型Id —— Guid? FacilityId
        /// <summary>
        /// 工厂模型Id
        /// </summary>
        public Guid? FacilityId { get; private set; }
        #endregion

        #region 排序 —— int Sort
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; private set; }
        #endregion

        #region 描述 —— string Description
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; private set; }
        #endregion

        #region 导航属性 - 工单 —— WorkOrder WorkOrder
        /// <summary>
        /// 导航属性 - 工单
        /// </summary>
        public virtual WorkOrder WorkOrder { get; internal set; }
        #endregion

        #endregion
    }
}
